package testPackage;

import java.util.ArrayList;
import java.util.Collection;
import java.util.InputMismatchException;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.Random;
import java.util.Scanner;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ArrayList<Integer> array = new ArrayList<Integer>();
		Scanner inp = new Scanner(System.in);
		A<Integer> a = new A<Integer>();
		try{
			while(inp.hasNext()){
				array.add(inp.nextInt());
				System.out.println(array);
			}
		}catch(InputMismatchException e){
		}
		System.out.println(aaaaaaa(array));
		
	}
	
	static ArrayList<Integer> aaaaaaa(ArrayList<Integer> aaaaaaaaa){
		int aaaaaaaaaa = aaaaaaaaa.get(new Random().nextInt(aaaaaaaaa.size()));
		ArrayList<Integer> aaaaaaaaaaa = new ArrayList<Integer>();
		ArrayList<Integer> aaaaaaaaaaaa = new ArrayList<Integer>();
		ArrayList<Integer> aaaaaaaaaaaaa = new ArrayList<Integer>();
		ArrayList<Integer> aaaaaaaaaaaaaa = new ArrayList<Integer>();
		
		for(int aaaaaaaa = 0; aaaaaaaa < aaaaaaaaa.size(); aaaaaaaa++){
			if(aaaaaaaaa.get(aaaaaaaa) > aaaaaaaaaa)
				aaaaaaaaaaaaaa.add(aaaaaaaaa.get(aaaaaaaa));
			else if(aaaaaaaaa.get(aaaaaaaa) < aaaaaaaaaa)
				aaaaaaaaaaa.add(aaaaaaaaa.get(aaaaaaaa));
			else
				aaaaaaaaaaaa.add(aaaaaaaaa.get(aaaaaaaa));
		}
		
		if(aaaaaaaaaaa.size() > 0)
			aaaaaaaaaaa = aaaaaaa(aaaaaaaaaaa);
		if(aaaaaaaaaaaaa.size() > 0)
			aaaaaaaaaaaaa = aaaaaaa(aaaaaaaaaaaaa);
		aaaaaaaaaaaaaa = aaaaaaaaaaa;
		aaaaaaaaaaaaaa.addAll(aaaaaaaaaaaa);
		aaaaaaaaaaaaaa.addAll(aaaaaaaaaaaaaa);	
		return aaaaaaaaaaaaaa;
	}

}


class A<T> implements List<T>{
		
	public int bla(){
		// TODO Auto-generated method stub
		return size();
	}

	@Override
	public boolean add(T e) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void add(int index, T element) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean addAll(Collection<? extends T> c) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean addAll(int index, Collection<? extends T> c) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void clear() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public boolean contains(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean containsAll(Collection<?> c) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public T get(int index) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int indexOf(Object o) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public boolean isEmpty() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Iterator<T> iterator() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int lastIndexOf(Object o) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public ListIterator<T> listIterator() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ListIterator<T> listIterator(int index) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean remove(Object o) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public T remove(int index) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean removeAll(Collection<?> c) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean retainAll(Collection<?> c) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public T set(int index, T element) {
		// TODO Auto-generated method stub
		return null;
	}
	
	public int a(){
		// TODO Auto-generated method stub
		return size();
	}

	@Override
	public int size() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public List<T> subList(int fromIndex, int toIndex) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Object[] toArray() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <T> T[] toArray(T[] a) {
		// TODO Auto-generated method stub
		return null;
	}
}

